<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>菜单配置</title>
        <link rel="stylesheet" type="text/css" href="../css/main1.css" />
        <link rel="stylesheet" type="text/css" href="../css/multiselect.css" />
        <style>
            .i_cdpx{background-image:url(../img/sucaiwcom8170000bzc.gif)!important;}
            .m_add{background-image:url(../img/cog_add.png)!important;}
            .m_del{background-image:url(../img/cog_delete.png)!important;}
            .m_hf{background-image:url(../img/cog_go.png)!important;}
            .m_sx{background-image:url(../img/arrow_refresh_small.png)!important;}
            .m_cdpz{background-image:url(../img/application_form_edit.png)!important;}

            .i_application{background-image:url(../img/tree/application.png)!important;}
            .i_application_cascade{background-image:url(../img/tree/application_cascade.png)!important;}
            .i_application_edit{background-image:url(../img/tree/application_edit.png)!important;}
            .i_application_form_edit{background-image:url(../img/tree/application_form_edit.png)!important;}
            .i_application_form_magnify{background-image:url(../img/tree/application_form_magnify.png)!important;}
            .i_application_home{background-image:url(../img/tree/application_home.png)!important;}
            .i_application_key{background-image:url(../img/tree/application_key.png)!important;}
            .i_application_side_list{background-image:url(../img/tree/application_side_list.png)!important;}
            .i_application_side_tree{background-image:url(../img/tree/application_side_tree.png)!important;}
            .i_application_split{background-image:url(../img/tree/application_split.png)!important;}
            .i_application_tile_horizontal{background-image:url(../img/tree/application_tile_horizontal.png)!important;}
            .i_application_tile_vertical{background-image:url(../img/tree/application_tile_vertical.png)!important;}
            .i_application_view_columns{background-image:url(../img/tree/application_view_columns.png)!important;}
            .i_application_view_gallery{background-image:url(../img/tree/application_view_gallery.png)!important;}
            .i_application_view_icons{background-image:url(../img/tree/application_view_icons.png)!important;}
            .i_application_view_list{background-image:url(../img/tree/application_view_list.png)!important;}
            .i_application_view_tile{background-image:url(../img/tree/application_view_tile.png)!important;}
            .i_arrow_switch{background-image:url(../img/tree/arrow_switch.png)!important;}
            .i_attach{background-image:url(../img/tree/attach.png)!important;}
            .i_database_key{background-image:url(../img/tree/database_key.png)!important;}
            .i_date{background-image:url(../img/tree/date.png)!important;}
            .i_edit{background-image:url(../img/tree/edit.gif)!important;}
            .i_flag_blue{background-image:url(../img/tree/flag_blue.gif)!important;}
            .i_flag_green{background-image:url(../img/tree/flag_green.gif)!important;}
            .i_flag_orange{background-image:url(../img/tree/flag_orange.gif)!important;}
            .i_flag_red{background-image:url(../img/tree/flag_red.gif)!important;}
            .i_flag_white{background-image:url(../img/tree/flag_white.gif)!important;}
            .i_folder{background-image:url(../img/tree/folder.gif)!important;}
            .i_folder_images{background-image:url(../img/tree/folder_images.gif)!important;}
            .i_folder_lock{background-image:url(../img/tree/folder_lock.gif)!important;}
            .i_folder_page{background-image:url(../img/tree/folder_page.gif)!important;}
            .i_folder_wrench{background-image:url(../img/tree/folder_wrench.png)!important;}
            .i_icon_attachment{background-image:url(../img/tree/icon_attachment.gif)!important;}
            .i_icon_component{background-image:url(../img/tree/icon_component.gif)!important;}
            .i_icon_favourites{background-image:url(../img/tree/icon_favourites.gif)!important;}
            .i_icon_network{background-image:url(../img/tree/icon_network.gif)!important;}
            .i_icon_package{background-image:url(../img/tree/icon_package.gif)!important;}
            .i_icon_padlock{background-image:url(../img/tree/icon_padlock.gif)!important;}
            .i_icon_security{background-image:url(../img/tree/icon_security.gif)!important;}
            .i_lightbulb_off{background-image:url(../img/tree/lightbulb_off.png)!important;}
            .i_note{background-image:url(../img/tree/note.png)!important;}
            .i_page_script{background-image:url(../img/tree/page_script.gif)!important;}
            .i_page_security{background-image:url(../img/tree/page_security.gif)!important;}
            .i_page_settings{background-image:url(../img/tree/page_settings.gif)!important;}
            .i_page_sound{background-image:url(../img/tree/page_sound.gif)!important;}
            .i_page_tag_blue{background-image:url(../img/tree/page_tag_blue.gif)!important;}
            .i_page_tag_red{background-image:url(../img/tree/page_tag_red.gif)!important;}
            .i_page_text{background-image:url(../img/tree/page_text.gif)!important;}
            .i_page_tree{background-image:url(../img/tree/page_tree.gif)!important;}
            .i_page_url{background-image:url(../img/tree/page_url.gif)!important;}
            .i_page_user{background-image:url(../img/tree/page_user.gif)!important;}
            .i_page_wizard{background-image:url(../img/tree/page_wizard.gif)!important;}
            .i_pollsmall{background-image:url(../img/tree/pollsmall.gif)!important;}
            .i_post{background-image:url(../img/tree/post.gif)!important;}
            .i_sound{background-image:url(../img/tree/sound.gif)!important;}
            .i_sucaiwcom-175100cip{background-image:url(../img/tree/sucaiwcom-175100cip.gif)!important;}
            .i_sucaiwcom11470kzb{background-image:url(../img/tree/sucaiwcom11470kzb.gif)!important;}
            .i_sucaiwcom16960kht{background-image:url(../img/tree/sucaiwcom16960kht.gif)!important;}
            .i_sucaiwcom2956000jum{background-image:url(../img/tree/sucaiwcom2956000jum.gif)!important;}
            .i_sucaiwcom30960kfn{background-image:url(../img/tree/sucaiwcom30960kfn.gif)!important;}
            .i_sucaiwcom3466000jur{background-image:url(../img/tree/sucaiwcom3466000jur.gif)!important;}
            .i_sucaiwcom35740hav{background-image:url(../img/tree/sucaiwcom35740hav.png)!important;}
            .i_sucaiwcom79250hvt{background-image:url(../img/tree/sucaiwcom79250hvt.png)!important;}
            .i_sucaiwcom79640gyr{background-image:url(../img/tree/sucaiwcom79640gyr.png)!important;}
            .i_sucaiwcom8170000bzc{background-image:url(../img/tree/sucaiwcom8170000bzc.gif)!important;}
            .i_sucaiwcom8350000bzr{background-image:url(../img/tree/sucaiwcom8350000bzr.gif)!important;}
            .i_sucaiwcom92350hwz{background-image:url(../img/tree/sucaiwcom92350hwz.png)!important;}
            .i_sucaiwcom94050hmf{background-image:url(../img/tree/sucaiwcom94050hmf.png)!important;}
            .i_sucaiwcom96740hbl{background-image:url(../img/tree/sucaiwcom96740hbl.png)!important;}
            .i_sucaiwcom97070kmh{background-image:url(../img/tree/sucaiwcom97070kmh.gif)!important;}
            .i_table{background-image:url(../img/tree/table.gif)!important;}
            .i_tables{background-image:url(../img/tree/tables.gif)!important;}
            .i_tradesmall{background-image:url(../img/tree/tradesmall.gif)!important;}

            .ux-icon-combo-icon {
                background-repeat: no-repeat;
                background-position: 0 50%;
                width: 18px;
                height: 14px;
            } 
            /* X-BROWSER-WARNING: this is not being honored by Safari */
            .ux-icon-combo-input {
                padding-left: 25px ! important;

            }

            .x-form-field-wrap .ux-icon-combo-icon {
                top: 3px;
                left: 5px;
                padding-left: 25px;
            }
            .ux-icon-combo-item {
                background-repeat: no-repeat ! important;
                background-position: 3px 50% ! important;
                padding-left: 25px ! important;
            }
            .x-check-group  {
                background:#B3CFEE;
                border-top:1px dotted #B5B8C8;
                border-bottom:1px dotted #B5B8C8;
            }
            .x-radio-group  {
                background: #B3CFEE;
                border-top:1px dotted #B5B8C8;
                border-bottom:1px dotted #B5B8C8;
            }
        </style>
        <{$showjs}>
        <link rel="stylesheet" type="text/css" href="/Plug-in/ext/resources/css/xtheme-slate.css" />
        <script type="text/javascript" src="/Plug-in/ext/DDView.js"></script>

        <script language="javascript">
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';

                function treeClick(node,e) {

                    Ext.getDom('tree-div3').innerHTML='<iframe scrolling="auto" name="centeriframe" id="centeriframe" frameborder="0" width="100%" height="600" src="./tree_config.php?op=load&tid='+node.id+'" ></iframe>';	

			
                    //center.html='sfwefw';		
                    /*		Ext.getCmp('name').setValue(node.text);
                        if(node.leaf==true){
                        Ext.getCmp('leaf').setValue('叶子节点');
                        }else{
                        Ext.getCmp('leaf').setValue('父节点');
                        }
                     */}
                var center = new Ext.Window({   
                    title    :'<{$clg.cdpz}>',   
                    width    :400,   
                    height   :300,  
                    closable:false,
                    draggable:false,
                    iconCls:'m_cdpz',
                    region     : 'center',
                    html:'<div id="tree-div3"><iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="./intro.htm"></iframe></div>',
                    modal    : false});
                center.show();
                var nav = new Ext.Panel({
                    title       : '<{$clg.cdpx}>',
                    iconCls		:'i_cdpx',
                    region      : 'west',
                    split       : true,
                    width       : 250,
                    collapsible : true,
                    html		:'<div id="tree" style="overflow:auto;width:100%;height:100%;"></div>'
                });
                var viewport = new Ext.Viewport({
                    layout:'border',
                    items:[
                        center,
                        nav
                    ]
                });
                var Tree = Ext.tree;
                var root = new Tree.AsyncTreeNode({
                    text: '根',
                    draggable:true,
                    id:'0'
                });
                var tree = new Tree.TreePanel({
                    id:'tree',
                    el:'tree',
                    autoScroll:true,
                    root:root,
                    animate:true,
                    enableDD:true,
                    height:Ext.get("tree").getHeight(),
                    useArrows:true,
                    border:false,
                    rootVisible:false,
                    containerScroll: true,
                    loader: new Tree.TreeLoader({
                        dataUrl:'tree.php',
                        requestMethod:'POST',
                        baseParams:{op:'list'}
                    })
                });
                //定义右键菜单
                var setree;
                var rightClick = new Ext.menu.Menu({
                    id :'rightClickCont',
                    items : [{
                            id:'rMenu1',
                            iconCls:'m_del',
                            text : '<{$clg.del}>',
                            handler:function (){
                                var tree = Ext.getCmp('tree');
                                tree.body.mask('<{$clg.wait}>...','x-mask-loading');
                                Ext.Ajax.request(
                                {
                                    waitMsg:'正在提交[Being submitted]....',
                                    method:'POST',
                                    params:{op:'del',id:setree.id,del:'1'},
                                    url:'tree.php',
                                    success:function(form, action) {
                                        setTimeout(function(){
                                            tree.body.unmask();
                                        },1000);
                                    },
                                    failure: function(form, action) {
                                    }
                                }
				
                            );
		
                            }
                        }, {
                            id:'rMenu3',
                            iconCls:'m_add',
                            text : '<{$clg.new}>',
                            handler:function(){
                                Ext.getDom('tree-div3').innerHTML='<iframe scrolling="auto" name="centeriframe" id="centeriframe" frameborder="0" width="100%" height="600" src="./tree_config.php?op=load" ></iframe>';	

                            }
                        }, {
                            id:'rMenu4',
                            iconCls:'m_hf',
                            text : '<{$clg.recover}>',
                            handler:function (){
                                var tree = Ext.getCmp('tree');
                                tree.body.mask('<{$clg.wait}>...','x-mask-loading');
                                Ext.Ajax.request(
                                {
                                    waitMsg:'正在提交[Being submitted]....',
                                    method:'POST',
                                    params:{op:'del',id:setree.id,del:'0'},
                                    url:'tree.php',
                                    success:function(form, action) {
                                        setTimeout(function(){
                                            tree.body.unmask();
                                        },1000);
                                    },
                                    failure: function(form, action) {
                                    }
                                }
				
                            );
		
                            }
                        }, {
                            id:'rMenu5',
                            text : '<{$clg.fresh}>' ,
                            iconCls:'m_sx',
                            handler:function (){
                                var tree = Ext.getCmp('tree');
                                tree.body.mask('<{$clg.wait}>...','x-mask-loading');
                                tree.root.reload();
                                tree.root.collapse(true,true);
                                setTimeout(function(){
                                    tree.body.unmask();
                                },1000);
                                //root.expand(true,true);
                            }
                        },{
                            id:'rMenu6',
                            text : '<{$clg.bdmxpz}>' ,
                            iconCls:'i_tablecfg',
                            handler:function (){
                                var pr=top.Ext.get('config-'+setree.id);
                                if(pr){
                                    pr.close();
                                }
                                top.xajax_loadUrl("<{$clg.bdmxpz}>"+setree.id,"./form/form_config.php?op=load&tid="+setree.id,750,500,true,setree.id);
                            }
                        }]
                });
                tree.on('contextmenu',function(node,event){
                    event.preventDefault(); //这行是必须的
                    rightClick.showAt(event.getXY());//取得鼠标点击坐标，展示菜
                    node.select();
                    setree = new Ext.tree.TreeNode({ 
                        id:'config-'+node.id, 
                        text:node.text 
                    });
                    //root.expand(true,true);
                });
                tree.on('nodedrop',function(e){
                    var tree = Ext.getCmp('tree');
                    tree.body.mask('<{$clg.wait}>...','x-mask-loading');
                    Ext.Ajax.request(
                    {
                        waitMsg:'正在提交[Being submitted]....',
                        method:'POST',
                        params:{op:'px',nowid:e.dropNode.id,prid:e.target.id,method:e.point},
                        url:'tree.php',
                        success:function(form, action) {
                            setTimeout(function(){
                                tree.body.unmask();
                            },1000);
                        },
                        failure: function(form, action) {
                        }
                    }
				
                );
                });
                tree.render();
                //root.expand(true,true);
                tree.on('click',treeClick);
            });
        </script>
    </head>
    <body>
    </body>
</html>